<template>
  <div class="shop">
    <div class="shop_title">
      <a :href="shopInfo.shopUrl"><img :src="shopInfo.shopLogo" alt=""></a>
      <span>{{shopInfo.shopName}}</span>
    </div>

    <div class="shop_desc">
      <div>
        <span>{{shopInfo.cSells}}</span>        
        <span>{{shopInfo.cGoods}}</span>
        <span>总销量</span>
        <span>全部宝贝</span>
      </div>
      <div class="shop_desc_right">
        <span v-for="item in shopInfo.score" :key="item.name" class="shop_desc_right1">
          <span>{{item.name}}</span>
          <span :class="{isBetter1:item.isBetter}" class="green1">{{item.score.toFixed(2)}}</span>
          <span :class="{isBetter2:item.isBetter}" class="green2">{{item.isBetter?"高":"低"}}</span>
        </span>
      </div>
    </div>

    <div class="come_shop"><a href="shopInfo.shopUrl">进店逛逛</a></div>
    
  </div>
</template>

<script>
export default {
  name: "DetailShop",
  props: {
    shopInfo: {
      type: Object,
      default(){
        return {}
      }
    }
  }
}
</script>

<style scpoed>
  .shop_title img{
    width: 40px;
    border-radius: 50%;
    border: 2px solid #f6f6f6;
    margin: 10px;
    vertical-align: middle;
  }

  .shop_title span{
    display: inline-block;
    vertical-align: middle;
    font-size: 15px;
  }

  .shop_desc{
    height: 70px;
    display: flex;
    margin: 10px 0px
  }

  .shop_desc div{
    flex:1;
  }

  .shop_desc div:nth-child(1){
    font-size: 12px;
    flex-wrap: wrap;
    box-sizing: border-box;
    display: flex;
    justify-content: space-around;
    padding: 15px;
    border-right: 2px solid #f6f6f6;
  }
  
  .shop_desc div:nth-child(1) span{
    width: 40%;
    text-align: center;
    font-weight: 550;
  }
  
  .shop_desc_right{
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    padding-left: 30px;
  }

  .shop_desc_right1{
    flex:1;
    display: block;
    font-size: 10px;
  }

  .shop_desc_right1 span {
    margin: 5px;
    line-height: 23.33px;
  }

  .green1{
    color: green;
  }
  .isBetter1{
    color: red
  }

  .green2{
    background-color: green;
    color: white;
    padding: 2px;
    border-radius: 3px;
    font-size: 10px;
  }

  .isBetter2{
    background-color: red;
  }

  .come_shop{
    width: 130px;
    height: 25px;
    line-height: 20px;
    margin: 20px auto;
    text-align: center;
    border: 2px solid #f6f6f6;
    border-radius: 10px;
    font-size: 10px;
    background-color: #f6f6f6;
  }


  


  
</style>